import zipfile
import base64
import os
import sys
import shutil
import webbrowser as web


fpath = ""

try:
    fpath = sys.argv[1]
except:
    fpath = input("FILE: ")

fname = os.path.basename(fpath).split('.')[0]
workfolder = sys.argv[0].replace(os.path.basename(sys.argv[0]),"")
dpath = "C:\\Software\\tmp\\"

try:
    shutil.rmtree(dpath)
    print("[+] DelDir Successfully")
except:
    print("[-] DelDir Failed")


#Unzip
with zipfile.ZipFile(fpath) as zf:
   zf.extractall(path=dpath)



INDEX_HTML = b'PCFET0NUWVBFIGh0bWw+PGh0bWw+PGhlYWQ+PG1ldGEgY2hhcnNldD0ndXRmLTgnIC8+PG1ldGEgbmFtZT0ndmlld3BvcnQnIGNvbnRlbnQ9J3dpZHRoPWRldmljZS13aWR0aCwgaW5pdGlhbC1zY2FsZT0xLjAsIG1heGltdW0tc2NhbGU9MS4wLCB1c2VyLXNjYWxhYmxlPW5vJyAvPgo8dGl0bGU+VmlldyBFbmJ4PC90aXRsZT4KPHN0eWxlPgoucmljaHRleHQgeyBwb3NpdGlvbjpyZWxhdGl2ZTsgZm9udC1zaXplOiAzMHB4OyBjb2xvcjogIzAwMDsgdGV4dC1zaGFkb3c6IDJweCAzcHggMXB4ICNGRkY7IHotaW5kZXg6IDU7IH0KLmdyb3VweyBwb3NpdGlvbjogcmVsYXRpdmU7IH0gLmJvZHl7IG1hcmdpbjogMHB4OyB9IGltZ3sgei1pbmRleDogMTsgfSBoM3sgbWFyZ2luOiAxMHB4OyB9CiNlbm93LXNob3d7IHRyYW5zZm9ybTpzY2FsZSgwLjc1LDAuNzUpO3RyYW5zZm9ybS1vcmlnaW46IDAlIDAlOyB9CmF7IHRleHQtZGVjb3JhdGlvbjpub25lOyBiYWNrZ3JvdW5kOiM2NWFkNTc7Y29sb3I6I0ZGRjtwYWRkaW5nOjVweDtib3JkZXItcmFkaXVzOjEwcHg7IH0KPC9zdHlsZT48L2hlYWQ+PGJvZHk+CjxjZW50ZXI+CjxoMz57e2NOYW1lfX08L2gzPgo8Y2V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lKSB7CgkJCWNvbnNvbGUubG9nKCJbRVJST1JdIFVuZXhwZWN0ZWQgU3RyaW5nIGluIGZ1bmN0aW9uICdkaXNwbGF5KFtwYWdlXSxtb2RlKSchIik7CgkJCXJldHVybjsKCQl9CgkJaWYobW9kZSA9PSBmYWxzZSB8fCBtb2RlID09IG51bGwpIHsKCQkJdGhpcy5YbWwySHRtbCh0aGlzLkdldFNsaWRlU291cmNlKCJTbGlkZV8iICsgcGFnZSArICIueG1sIikpOwoJCX0gZWxzZSB7CgkJCXZhciB4bWxodHRwOwoJCQlpZiAod2luZG93LlhNTEh0dHBSZXF1ZXN0KXt4bWxodHRwPW5ldyBYTUxIdHRwUmVxdWVzdCgpO30KCQkJZWxzZXt4bWxodHRwPW5ldyBBY3RpdmVYT2JqZWN0KCJNaWNyb3NvZnQuWE1MSFRUUCIpO30KCQkJeG1saHR0cC5vbnJlYWR5c3RhdGVjaGFuZ2U9ZnVuY3Rpb24oKXsKCQkJCWlmICh4bWxodHRwLnJlYWR5U3RhdGUgPT0gNCAmJiB4bWxodHRwLnN0YXR1cyA9PSAyMDApewoJCQkJCXRoaXMuWG1sMkh0bWwoeG1saHR0cC5yZXNwb25zZVhNTCk7CgkJCQl9CgkJCX0KCQkJeG1saHR0cC5vcGVuKCJHRVQiLCB0aGlzLnNsaVBhdGggKyAiU2xpZGVfIiArIHBhZ2UgKyAiLnhtbCIsdHJ1ZSk7CgkJCXhtbGh0dHAuc2VuZCgpOwoJCX0KCX0KfQ=='

INDEX_HTML = str(base64.b64decode(INDEX_HTML), "utf-8")
OPENENOW_JS = str(base64.b64decode(OPENENOW_JS), "utf-8")

INDEX_HTML = INDEX_HTML.replace("{{cName}}", fname)

with open(dpath + "index.html",'a') as f:
    f.write(INDEX_HTML)
    
with open(dpath + "openEnow.js",'a') as f:
    f.write(OPENENOW_JS)

web.open("http://localhost:8080/",0,False)
print("[*] Starting Local Server (http://localhost:8080/)")
os.system(workfolder + "uweb.exe -p 8080 -d " + dpath + " -cb -ct -q")
